﻿using System;
using Archie.Retail.AdminTool.WpfFeatures;
using Archie.Retail.Data;

namespace Archie.Retail.AdminTool.UI.ViewModels
{
    public class DoorManufacturerVM : NotificationObject
    {
        private readonly IDataManager _dataManager;
        public DoorManufacturer DoorManufacturer { get; private set; }

        public Guid Id
        {
            get { return DoorManufacturer.Id; }
        }

        public string Name
        {
            get { return DoorManufacturer.Name; }
            set
            {
                if (DoorManufacturer.Name == value)
                {
                    return;
                }

                DoorManufacturer.Name = value;
                OnPropertyChanged("Name");
            }
        }

        public DoorManufacturerVM(IDataManager dataManager, DoorManufacturer doorManufacturer)
        {
            if (dataManager == null)
            {
                throw new ArgumentNullException("dataManager");
            }
            if (doorManufacturer == null)
            {
                throw new ArgumentNullException("doorManufacturer");
            }

            _dataManager = dataManager;
            DoorManufacturer = doorManufacturer;
        }
    }
}
